package com.rocketmq.temp3.common.constant;

/**
 * 与业务相关常量
 */
public interface BizConstant {
    enum SmsState {
        FAILURE_RETURN(0, "返回失败"),
        WAITING_SEND(1, "待发送"),
        LAZY_SEND(2, "延时发送"),
        FAILURE_SEND(3, "发送失败"),
        SUCCESS_SEND(4, "成功"),
        WAITING_STATE(5, "等待状态中");

        private Integer state;
        private String text;

        SmsState(Integer state, String text) {
            this.state = state;
            this.text = text;
        }

        public Integer getState() {
            return state;
        }

        public String getText() {
            return text;
        }
    }

    enum ResultCode {
        SUCCESS(200, "请求成功"),
        ERROR(500, "服务器异常"),
        SEND_SUCCESS(1000, "发送成功"),
        SEND_FAILURE(2001, "发送失败"),
        IP_ERROR(2002, "IP认证失败，请联系UMP系统管理员配置权限"),
        MISS_STRATEGY(2003, "发送策略缺失"),
        SEND_WAITING(2004, "待发送"),
        UNKNOWN_ERROR(9000, "未知错误"),
        CONTENT_TYPE(5001, "post请求仅支持application/x-www-form-urlencoded数据格式"),
        TIMESTAMP_ERROR(5002, "时间戳过期或失效"),
        APP_KEY_ERROR(5003, "appkey无效，appkey在系统中不存在或未分配权限"),
        SIGN_ERROR(5004, "非法签名，签名验证失败"),
        VERSION_ERROR(5005, "接口版本不符合");

        private Integer code;
        private String message;

        ResultCode(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return this.code;
        }

        public String getMessage() {
            return this.message;
        }
    }
}
